GBML manual / Camera

camera_follow_ease

Configures how fast camera_follow’s eased catch-up closes the remaining whole-pixel gap each frame, independently per axis. Defaults to 0.08/0.08 (today’s built-in feel) until this is called.

Syntax

camera_follow_ease(x_factor, y_factor)

Arguments

NameType
x_factorreal
y_factorreal

Returns

Nothing.

Description

Configures how fast camera_follow's eased catch-up closes the remaining whole-pixel gap each frame, independently per axis. Both axes default to 0.08 (today's built-in feel) until this is called.

This is a project-wide setting, not something tied to whichever instance is currently followed - it stays exactly as set across any number of camera_follow/camera_unfollow calls, switching targets, and even a cutscene ending (which hands the camera back to whatever camera_follow was last pointed at - see cutscene_stop). Set it once, e.g. in a room's Create event, and it holds until something changes it again.

Valid range

1 means no lag at all - every frame shows the target's exact clamped position, still floored to whole pixels the same way normal drawing already is, so it reads as a deliberate snap-tight follow rather than a bug. Anything in (0, 1) still eases, just faster the closer it is to 1.

0 is refused rather than accepted or clamped: it would freeze the camera at whatever whole-pixel offset it already has, forever - the camera would simply stop catching up, with nothing visibly wrong in the code to explain why.

Example

camera_follow_ease(0.2, 0.2);

A snappier, less floaty follow than the default 0.08 - the camera closes about a fifth of the remaining gap every frame instead of about a twelfth. Calling camera_follow_ease before or after camera_follow makes no difference; the setting and the target it eases toward are independent of each other.

On the GBA

Valid range is (0, 1]: 1 means no lag at all (the camera shows the target’s exact clamped position every frame, still floored to whole pixels like normal drawing); 0 is refused - it would freeze the camera at whatever whole-pixel offset it already has and it would never catch up again. This is a project-wide setting, orthogonal to WHICH instance camera_follow is currently tracking: switching targets, or a cutscene ending (which restores whatever camera_follow was last pointed at - see cutscene_stop), never resets this back to the default by itself. Set it once (a room’s Create event, say) and it holds until changed again.

See also: camera_followcamera_snap